package com.ctec.controller;

import com.ctec.service.DataIntegrationService;
import com.ctec.util.R;
import com.ctec.vo.DynamicData;
import com.ctec.vo.IntegrationForm;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "数据入库对外接口")
@RequestMapping("endpoint")
public class DataIntegrationEndpoint {

    @Resource
    private DataIntegrationService dataIntegrationService;

    /**
     * 如果数据嵌套复杂，需要用户自己解析，调用数据入库接口
     */
    @Operation(description = "数据解析后接入")
    @PostMapping("integration")
    public R integration(@RequestBody DynamicData filedChangeForm) {

        return dataIntegrationService.doIntegration(filedChangeForm);
     }


}
